package com.example.choupaiapp.main.view;

import android.content.Context;
import android.util.AttributeSet;

import com.example.choupaiapp.main.callback.ScrollChangedListener;
import com.tencent.smtt.sdk.WebView;

/**
 * Created by ASUS on 2020/4/22.
 */

public class MyWebview extends WebView {

    public ScrollChangedListener scrollChangedListener;

    public MyWebview(Context context) {
        super(context);
    }

    public MyWebview(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public MyWebview(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if (scrollChangedListener != null) {
            scrollChangedListener.onChanged(l, t, oldl, oldt);
        }
    }

    public void setOnMyScrollChangedListener(ScrollChangedListener scrollChangedListener) {
        this.scrollChangedListener = scrollChangedListener;
    }
}
